<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>Hello</h1>
    [[${message}]]
    [(${message})]
    <div th:text="${message}"></div>

    <a href="javascript:;" th:data-message="${message}">message</a>

    <div th:text="${emps}"></div>

    <table>
        <tr>
            <th>序号</th>
            <th>id</th>
            <th>name</th>
            <th>salary</th>
        </tr>

        <tr th:each="emp,i : ${emps}">
            <td>[[${i.count}]]</td>
            <td>[[${emp.id}]]</td>
            <td>[[${emp.name}]]</td>
            <td th:if="${emp.salary<10000}" style="color: red;">[[${emp.salary}]]</td>
            <td th:if="${emp.salary>=10000}" style="color: green;">[[${emp.salary}]]</td>
        </tr>
    </table>

    [[${user}]]

    <form action="#">
        <input type="hidden" name="id" th:value="${user.id}"/>
        username:<input type="text" name="username" th:value="${user.username}"/><br/>
        password:<input type="password" name="password" th:value="${user.password}"/><br/>
        sex:<input type="radio" name="sex" value="0" th:checked="${'0' eq user.sex? 'checked':'false'}"/>女
            <input type="radio" name="sex" value="1" th:checked="${'1' eq user.sex? 'checked':'false'}"/>男<br/>
        edu:<select name="edu">
                <option value="0">---请选择---</option>
                <option value="1"  th:selected="${'1' eq user.edu? 'selected':'false'}">高中</option>
                <option value="2" th:selected="${'2' eq user.edu? 'selected':'false'}">专科</option>
                <option value="3" th:selected="${'3' eq user.edu? 'selected':'false'}">本科</option>
            </select><br/>
        hobbies:<input type="checkbox" name="hobbies" value="1" th:checked="${(#arrays.contains(user.hobbies,'1'))?'checked':'false'}"/>吃
                <input type="checkbox" name="hobbies" value="2" th:checked="${(#arrays.contains(user.hobbies,'2'))?'checked':'false'}"/>玩
                <input type="checkbox" name="hobbies" value="3" th:checked="${(#arrays.contains(user.hobbies,'3'))?'checked':'false'}"/>睡<br/>
        description:<textarea rows="5" cols="20" name="description">[[${user.description}]]</textarea>
    </form>


    <hr/>

    <form action="#">
        <input type="hidden" name="id" th:field="${user.id}"/>
        username:<input type="text" name="username" th:field="${user.username}"/><br/>
        password:<input type="password" name="password" th:field="${user.password}"/><br/>
        sex:<input type="radio" name="sex" value="0" th:field="${user.sex}"/>女
        <input type="radio" name="sex" value="1" th:field="${user.sex}"/>男<br/>
        edu:<select name="edu" th:field="${user.edu}">
                <option value="0">---请选择---</option>
                <option value="1">高中</option>
                <option value="2">专科</option>
                <option value="3">本科</option>
            </select><br/>
        hobbies:<input type="checkbox" name="hobbies" value="1" th:field="${user.hobbies}"/>吃
                <input type="checkbox" name="hobbies" value="2" th:field="${user.hobbies}"/>玩
                <input type="checkbox" name="hobbies" value="3" th:field="${user.hobbies}"/>睡<br/>
        description:<textarea rows="5" cols="20" name="description" th:field="${user.description}"></textarea>
        <input type="submit"/>
    </form>

    <hr/>

    <div th:text="${#dates.format(date,'yyyy/MM/dd HH:mm:ss')}"></div>

</body>
</html>